package idun.config;

import idun.dao.RestaurantDao;
import idun.service.LunchPicker;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration

public class AppConfig {
	public static void main(String[] args){
		try {
			AnnotationConfigApplicationContext ctx =new AnnotationConfigApplicationContext(AppConfig.class);
			LunchPicker lunchPicker = ctx.getBean(LunchPicker.class);
			lunchPicker.pickeRestaurant(10);
			ctx.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	@Bean
	public RestaurantDao restaurantDao(){
		return new RestaurantDao();
	}
	@Bean
	public LunchPicker luchLunchPicker(){
		 LunchPicker lunchPicker = new LunchPicker();
//		 lunchPicker.setRestaurantDao(restaurantDao());
		 return lunchPicker;
		 
	}

}
